﻿#include "DataPackageInfo.h"

DataPackageInfo::DataPackageInfo(QObject *parent) : QObject(parent)
{

}

DataPackageInfo::DataPackageInfo(const DataPackageInfo& dataPackageInfo)
{
  setSenderAddress(dataPackageInfo.getSenderAddress());
  setSenderPort(dataPackageInfo.getSenderPort());
  setReceiverAddress(dataPackageInfo.getReceiverAddress());
  setReceiverPort(dataPackageInfo.getReceiverPort());
  setPackageType(dataPackageInfo.getPackageType());
  setMsgId(dataPackageInfo.getMsgId());
  setData(dataPackageInfo.getData());
  setCreateTime(dataPackageInfo.getCreateTime());
}

QHostAddress DataPackageInfo::getSenderAddress() const
{
  return senderAddress;
}

void DataPackageInfo::setSenderAddress(const QHostAddress senderAddress)
{
  this->senderAddress=senderAddress;
}

uint DataPackageInfo::getSenderPort() const
{
  return senderPort;
}

void DataPackageInfo::setSenderPort(const uint senderPort)
{
  this->senderPort=senderPort;
}

QHostAddress DataPackageInfo::getReceiverAddress() const
{
  return receiverAddress;
}

void DataPackageInfo::setReceiverAddress(const QHostAddress receiverAddress)
{
  this->receiverAddress=receiverAddress;
}

uint DataPackageInfo::getReceiverPort() const
{
  return receiverPort;
}

void DataPackageInfo::setReceiverPort(const uint receiverPort)
{
  this->receiverPort=receiverPort;
}

uchar DataPackageInfo::getPackageType() const
{
  return packageType;
}

void DataPackageInfo::setPackageType(const uchar packageType)
{
  this->packageType=packageType;
}

ushort DataPackageInfo::getMsgId() const
{
  return msgId;
}
void DataPackageInfo::setMsgId(const ushort msgId)
{
  this->msgId=msgId;
}
QByteArray DataPackageInfo::getData() const
{
  return data;
}
void DataPackageInfo::setData(const QByteArray data)
{
  this->data=data;
}

QDateTime DataPackageInfo::getCreateTime() const
{
  return createTime;
}

void DataPackageInfo::setCreateTime(const QDateTime createTime)
{
  this->createTime=createTime;
}

DataPackageInfo &DataPackageInfo::operator=(const DataPackageInfo &dataPackageInfo)
{
  setSenderAddress(dataPackageInfo.getSenderAddress());
  setSenderPort(dataPackageInfo.getSenderPort());
  setReceiverAddress(dataPackageInfo.getReceiverAddress());
  setReceiverPort(dataPackageInfo.getReceiverPort());
  setPackageType(dataPackageInfo.getPackageType());
  setMsgId(dataPackageInfo.getMsgId());
  setData(dataPackageInfo.getData());
  setCreateTime(dataPackageInfo.getCreateTime());
  return *this;
}
